
const request = require('./request')
module.exports = {

  playlistU: async ( query) => {
    const {raw} = query;

    const data = {
      data: JSON.stringify({
        comm: {
          ct: 24
        },
        recomPlaylist: {
          method: "get_hot_recommend",
          param: {
            async: 1,
            cmd: 2
          },
          module: "playlist.HotRecommendServer"
        }
      })
    };

    const result = await request(
      'http://u.y.qq.com/cgi-bin/musicu.fcg?data='+data.data,
    );

    if (Number(raw)) {
      return result;
    } else {
      const list = result.recomPlaylist.data.v_hot;
      return {
        result: 100,
        data: {
          list,
          count: list.length,
        }
      }
    }
  },



}
